import request from "@/utils/request";
import { getParamsSuffix } from "@/utils/paramsUtils";


/**
 * 列表村
 * @param query
 * @returns {Promise<any>}
 */
export async function getBindVillagesList(query) {
    const params = getParamsSuffix(query);
    return request(`/api/cdcerserver/v1/orgsetting/getBindVillagesList?${params}`);
}


/**
 * 绑定村：保存
 * @param params
 * @returns {Promise<any>}
 */
export async function saveBindList(params) {
    return request('/api/cdcerserver/v1/orgsetting/saveBindList', {
        method: 'POST',
        requestType: 'form',
        data: { ...params },
    });
}


/**
 * 查看
 * @param query
 * @returns {Promise<any>}
 */
export async function echoBindCodes(query) {
    const params = getParamsSuffix(query);
    return request(`/api/cdcerserver/v1/orgsetting/echoBindCodes?${params}`);
}


/**
 * 绑定
 * @param query
 * @returns {Promise<any>}
 */
export async function lock(query) {
    const params = getParamsSuffix(query);
    return request(`/api/cdcerserver/v1/orgsetting/lock?${params}`);
}



/**
 * 解绑
 * @param query
 * @returns {Promise<any>}
 */
export async function unlock(query) {
    const params = getParamsSuffix(query);
    return request(`/api/cdcerserver/v1/orgsetting/unlock?${params}`);
    // return request(`/api/cdcerserver/v1/orgsetting/lock?${params}`);

}
